// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';

/**
 * 基础菜单
 */
// 商品管理
import Goods from '@/views/goods/Goods';

// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: index,
        hidden: true
    }, {
        path: '/login',
        name: 'login',
        component: login,
        hidden: true
    }, 
    {
        path: '/register',
        name: 'register',
        component: () => import('@/views/register/index'), //注册页面
        hidden: true,
    },
    {
        path: '/authentication',
        name: 'authentication',
        component: () => import('@/views/register/authentication'), //信息认证页面
        hidden: true,
    },
    {
        path: '/index',
        name: 'index',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [
        {
            path: '/main',
            name: 'main',
            component: () => import('@/views/main/index'), //协会信息页面
        }, 
        {
            path: '/farmer/index',
            name: 'farmer',
            component: () => import('@/views/farmer/index'), //农户管理页面
        },
        {
            path: '/farmer/auditList',
            name: 'auditList',
            component: () => import('@/views/farmer/auditList'), //农户审核页面
        },
        {
            path: '/farmer/auditDetails',
            name: 'auditDetails',
            component: () => import('@/views/farmer/auditDetails'), //农户审核详情页面
        },
        {
            path: '/staff/index',
            name: 'staff',
            component: () => import('@/views/staff/index'), //农户管理页面
        },
        {
            path: '/product/index',
            name: 'product',
            component: () => import('@/views/product/index'), //农户管理页面
        },
        {
            path: '/product/auditProduct',
            name: 'auditProduct',
            component: () => import('@/views/product/auditProduct'), //农户审核页面
        },
        {
            path: '/product/detailProduct',
            name: 'detailProduct',
            component: () => import('@/views/product/detailProduct'), //农户审核详情页面
        },
    ]
    }]
})